GXGetPolygonParts
You can use theGXGetPolygonParts
function to copy a specified range of geometric points from the geometry of a polygon shape and then put these points into a polygon structure.
long GXGetPolygonParts(gxShape source, long index, long count, gxPolygons *data);
source
- A reference to the polygon shape containing the desired geometric points.
index
- The geometry index of the first geometric point to copy.
count
- The number of the geometric points to copy. You may provide the
gxSelectToEnd
constant for this parameter.data
- A pointer to a polygon structure to hold the copied geometric information.
- function result
- The number of bytes required to hold the information returned in the
data
parameter.DESCRIPTION
TheGXGetPolygonParts
function copies geometry information from the source polygon shape into the polygon structure specified by thedata
parameter. This function copies all of the geometry information starting with the geometric point indicated by theindex
parameter and continuing for as many geometric points as indicated by thecount
parameter. This function copies the values of the indicated geometric points and retains the information about contour breaks from the original geometry. The function result is the length in bytes of the information returned in thedata
parameter.Both the
index
and thecount
parameters must be greater than 0, although you can provide thegxSelectToEnd
constant for thecount
parameter, which indicates that you want a copy of all the geometric points starting with the point indicated by theindex
parameter.You may pass
nil
for thedata
parameter. In this case, the function still returns the byte length as the function result, but does not copy any geometry information.Typically, to use this function, you go through these steps:
- Determine the byte length needed to store the copied geometry information by calling this function, passing
nil
for thedata
parameter.- Allocate enough memory to hold the copied geometric information.
- Call this function again, passing a pointer to the allocated memory in the
data
parameter.
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil illegal_type_for_shape (debugging version) index_is_less_than_one (debugging version) count_is_less_than_one (debugging version) Warnings index_out_of_range count_out_of_range SEE ALSO
For an example that uses this function, see "Editing Polygon Parts" beginning on page 2-82.For a discussion of polygons, see "Polygon Shapes" on page 2-22.
For the definition of the
gxPolygons
structure, see page 2-106.For information about other functions that allow you to extract information from shape geometries, see the description of the
GXGetShapePoints
function on page 2-140 and the description of theGXGetShapeParts
function on page 2-152.To replace parts of a polygon shape's geometry, use the
GXSetPolygonParts
function, which is described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help